package day10;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Ques1853 {
	
	public void go(){
		Scanner scan = new Scanner(System.in);
		outter:while(scan.hasNext()){
			int n = scan.nextInt();
			int[] arr = new int[n];
			int range = n - 1;
			boolean flag = false;
			for (int i = 0; i < n; i++) {
				arr[i] = scan.nextInt();
			}
			List<Integer> list = new ArrayList<>();
			List<Integer> resultList = new ArrayList<>();
			for (int i = 1; i < n; i++) {
				list.add(i);
			}
			int result = 0;
			for(int i = 0;i < n - 1;i ++){
				result = Math.abs(arr[i] - arr[i+1]);
				resultList.add(result);
				if(result < 1 && result >= n - 1){
					System.out.println("Not jolly");
					continue outter;
				}
			}
			if(list.contains(result)){
				System.out.println("Jolly");
				continue outter;
			}
			System.out.println("Not jolly");
		}
	}
	
	public static void main(String[] args) {
		new Ques1853().go();
	}
}
